using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Money_Log_Mobile
{
    public partial class frmAddTransaction : Form
    {
        private Bank oBank;
        public frmAddTransaction(Bank BankOpen)
        {
            InitializeComponent();
            oBank = BankOpen;
        }

        private void menuAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Double.Parse(txtAmount.Text);
                oBank.AddTransaction(txtName.Text, Convert.ToDouble(txtAmount.Text), new List<string>(), dtAdded.Value );
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Enter a valid number");
            }
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}